package lab03.test04;

import java.io.*;

public class Test04 {
    public static void main(String[] args) {
        String source = "F:jsoup-1.10.3.jar";
        String target = "E:jsoup-1.10.3.jar";
        FileInputStream fileInputStream = null;
        FileOutputStream fileOutputStream = null;
        try {
            fileInputStream = new FileInputStream(source);
            fileOutputStream = new FileOutputStream(target);
            int data;
            //读一个字节就写入一个字节
            while ((data = fileInputStream.read()) != -1){
                fileOutputStream.write(data);
            }
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }finally {
            try {
                fileInputStream.close();
            } catch (IOException e) {
                e.printStackTrace();
            }
            try {
                fileOutputStream.close();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
    }
}
